﻿Imports System.ComponentModel

Public Class SortableGridViewColumn
    Inherits GridViewColumn

    Public Shared ReadOnly IsDefaultSortColumnProperty As DependencyProperty = _
        DependencyProperty.Register("IsDefaultSortColumn", GetType(Boolean), GetType(SortableGridViewColumn), New UIPropertyMetadata(False))
    Public Shared ReadOnly DefaultSortDirectionProperty As DependencyProperty = _
        DependencyProperty.Register("DefaultSortDirection", GetType(ListSortDirection), GetType(SortableGridViewColumn), New UIPropertyMetadata(ListSortDirection.Ascending))
    Public Shared ReadOnly SortPropertyNameProperty As DependencyProperty = _
        DependencyProperty.Register("SortPropertyName", GetType(String), GetType(SortableGridViewColumn), New UIPropertyMetadata(""))


    Public Property SortPropertyName() As String
        Get
            Return CStr(GetValue(SortPropertyNameProperty))
        End Get
        Set(ByVal value As String)
            SetValue(SortPropertyNameProperty, value)
        End Set
    End Property

    Public Property DefaultSortDirection() As ListSortDirection
        Get
            Return DirectCast(GetValue(DefaultSortDirectionProperty), ListSortDirection)
        End Get
        Set(ByVal value As ListSortDirection)
            SetValue(DefaultSortDirectionProperty, value)
        End Set
    End Property

    Public Property IsDefaultSortColumn() As Boolean
        Get
            Return CBool(GetValue(IsDefaultSortColumnProperty))
        End Get
        Set(ByVal value As Boolean)
            SetValue(IsDefaultSortColumnProperty, value)
        End Set
    End Property

End Class
